
import Vue from 'vue'
import VueRouter from "vue-router"
Vue.use(VueRouter)
import DemoIndex from '../views/demo'
import AppCopy from '../AppCopy'
import Index from '../views/index'
//此VueRouter是自己自定义引入暴露出来的，即是自定义的，以下的VueRouter同样是这样
// 解决两次访问相同路由地址报错
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}


const router=new VueRouter({
    routes:[
        //配置路由的路径
        {
            path:'/',
            component:Index
        },
        {
            path:'/app',
            component:AppCopy
        },
        {
            path:'/demo',
            component:DemoIndex,
        }
        
    ]
})
export default router;
